package com.stox.shared.model;

import java.util.List;

import com.stox.shared.util.StringUtil;

public class Watchlist extends AbstractModel {

	private transient List<WatchlistEntry> entries;
	
	public Watchlist() {
		
	}
	
	public Watchlist(String text) {
		String[] tokens = text.split(",");
		if(0 < tokens.length && StringUtil.hasText(tokens[0])) setId(Long.parseLong(tokens[0]));
		if(1 < tokens.length) setName(tokens[1]);
	}
	
	@Override
	public String toString() {
		return getId()+","+getName();
	}
	
	public List<WatchlistEntry> getEntries() {
		return entries;
	}
	
	public void setEntries(List<WatchlistEntry> entries) {
		this.entries = entries;
	}
	
}
